import 'dart:ffi';

import 'package:flutter/services.dart';
import 'package:jl_plugin/bean/KeySettings.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'bean/BlueDevice.dart';
import 'bean/EqInfo.dart';
import 'bean/JlResult.dart';
import 'jl_plugin_method_channel.dart';

abstract class JlPluginPlatform extends PlatformInterface {
  /// Constructs a JlPluginPlatform.
  JlPluginPlatform() : super(token: _token);

  static final Object _token = Object();
  final methodChannel = const MethodChannel('jl_plugin');
  static JlPluginPlatform _instance = MethodChannelJlPlugin();

  /// The default instance of [JlPluginPlatform] to use.
  ///
  /// Defaults to [MethodChannelJlPlugin].
  static JlPluginPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [JlPluginPlatform] when
  /// they register themselves.
  static set instance(JlPluginPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<bool?> initSdk(Map<String,dynamic> paramMap){
    throw UnimplementedError('initSdk() has not been implemented.');
  }

  Future<bool?> startScanBlue(){
    throw UnimplementedError('startScanBlue() has not been implemented.');
  }

  Future<bool?> stopScanBlue(){
    throw UnimplementedError('stopScanBlue() has not been implemented.');
  }

  Future<Map?> connectBlue(String address,int connectWay){
    throw UnimplementedError('connectBlue() has not been implemented.');
  }

  Future<bool?> disconnectBlue(BlueDevice device){
    throw UnimplementedError('disconnectBlue() has not been implemented.');
  }
  Future<bool?> disconnectBlue2(String address){
    throw UnimplementedError('disconnectBlue() has not been implemented.');
  }

  Future<JlResult> configKeySettings(List<KeySetting> keySettingList){
    throw UnimplementedError('configKeySettings() has not been implemented.');
  }

  Future<Map> getDevicesSetting(int mask){
    throw UnimplementedError('getDevicesSetting() has not been implemented.');
  }

  Future<bool?> settingEq(EqInfo eqInfo){
    throw UnimplementedError('settingEq() has not been implemented.');
  }

  Future getEqSetting(){
    throw UnimplementedError('getEqSetting() has not been implemented.');
  }

  Future sendCmd(String cmd){
    throw UnimplementedError('sendCmd() has not been implemented.');
  }

  Future<Map?> modifyHeadsetFunctions(int attrType,List<Int> paramData){
    throw UnimplementedError('modifyHeadsetFunctions() has not been implemented.');
  }

  Future<Map?> changeDeviceName(String name){
    throw UnimplementedError('changeDeviceName() has not been implemented.');
  }

  Future<Map?> rebootDevice(){
    throw UnimplementedError('rebootDevice() has not been implemented.');
  }

  Future<Map?> getCurrentDevices(){
    throw UnimplementedError('getCurrentDevices() has not been implemented.');
  }

  Future<List?> getHistoryBluetoothDeviceList(){
    throw UnimplementedError('getHistoryBluetoothDeviceList() has not been implemented.');
  }

  Future<Map?> findHistoryBluetoothDevice(String address){
    throw UnimplementedError('findHistoryBluetoothDevice() has not been implemented.');
  }

  Future<bool?> isConnectioned(){
    throw UnimplementedError('isConnectioned() has not been implemented.');
  }

  Future<bool?> isConnecting(){
    throw UnimplementedError('isConnecting() has not been implemented.');
  }

  Future<bool?> isScanning(){
    throw UnimplementedError('isScanning() has not been implemented.');
  }

  Future<bool?> isInit(){
    throw UnimplementedError('isScanning() has not been implemented.');
  }

  Future<bool?> removeHistoryBluetoothDevice(String address){
    throw UnimplementedError('removeHistoryBluetoothDevice() has not been implemented.');
  }

  Future<bool?> stopReconnect(){
    throw UnimplementedError('stopReconnect() has not been implemented.');
  }

  Future<bool?> startReconnect(){
    throw UnimplementedError('startReconnect() has not been implemented.');
  }

  Future<bool?> startRecord(){
    throw UnimplementedError('startRecord() has not been implemented.');
  }

  Future<bool?> stopRecord(){
    throw UnimplementedError('stopRecord() has not been implemented.');
  }

  // Future<bool?> getRecordStatus(){
  //   throw UnimplementedError('getRecordStatus() has not been implemented.');
  // }

  Future<bool?> startDecode(){
    throw UnimplementedError('startDecode() has not been implemented.');
  }

  Future<bool?> stopDecode(){
    throw UnimplementedError('stopDecode() has not been implemented.');
  }

  Future<bool?> releaseDecode(){
    throw UnimplementedError('releaseDecode() has not been implemented.');
  }

  Future decodeOpus(Uint8List data){
    throw UnimplementedError('decodeOpus() has not been implemented.');
  }

}
